import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import axios from 'axios'

Vue.config.productionTip = false

new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')


// 全局默认值
/*axios.defaults.baseURL = 'http://www.lianzhong.com';
axios.defaults.timeout = 5000

let option1 = {
    url: 'api/test',
    params: {
        name: '小王',
        sex: '女',
        'like': '玩哦'
    }
};

let option2 = {
    url: 'api/test',
    method: 'post'
};*/

/*axios(option).then(res => {
    console.log(res);
});*/

/*
axios.post('http://www.lianzhong.com/api/test').then(res=>{
    console.log(res);
})*/
/*
axios.all([
    axios(option1),
    axios(option2),
]).then(([res1, res2]) => {
    console.log(res1);
    console.log(res2);
});*/


/*let indexAxios = axios.create({
    baseURL: 'http://www.lianzhong.com',
    timeout: 5000
})

let bookAxios = axios.create({
    baseURL: 'http://www.lianzhong.com',
    timeout: 5000
})*/
/*

indexAxios({
    url: 'api/test',
    params: {
        name: '小王',
        sex: '女',
        'like': '玩哦'
    }
}).then(res => {
    console.log(res);
})
*/


/*bookAxios({
    url: 'api/test',
    method:'post',
    data: {
        name: '小王',
        sex: '女',
        'like': '玩哦'
    }
}).then(res => {
    console.log(res);
})*/


import {request, request2} from "./network/request";

let option = {
    url: 'api/test',
    method: 'post',
    data: {
        name: '小王',
        sex: '女',
        like: '玩哦'
    }
}

request(option).then(res => {
    console.log(res);
})

request2(option,function (res) {
    console.log(res);
})

